const dbCfg = {
  dev: {
    host: '172.23.7.241',
    port: '3306',
    user: 'tendcloud',
    password: 'tendcloudpasswd',
    database: 'tenddata'
  },
  prod: {
    host: '10.16.16.90',
    port: '3306',
    user: 'tendcloud',
    password: 'tendcloudpasswd',
    database: 'tenddata'
  }
};

const curCfg = process.env.NODE_ENV === 'dev' || process.env.NODE_ENV === 'local' ? dbCfg.dev : dbCfg.prod;
console.log('========start========');
console.log(process.env.NODE_ENV);
console.log('========end========');

const mysql_1 = require("mysql");
let connection = mysql_1.createConnection(curCfg);
connection.connect();

const ConnUtil = {
  getConn() {
    return connection;
  }
};

module.exports = ConnUtil;